<?php
if (count($data)) :
  $destination = drupal_get_destination();
  ?>
  <table id="webform-career" class="webform-result">
    <thead>
      <tr class="heading">
        <td><?php print t('ID'); ?></td>        
        <td><?php print t('University/College Name'); ?></td>
        <td><?php print t('Date created'); ?></td>
        <td><?php print t('Operations'); ?></td>
      </tr>
    </thead>
    <?php
    foreach ($data as $submission) :
      $result = $submission->data;
      $education = '';
      if (isset($submission->data[3]['value'][0])) {//University
        $tid = str_replace('tid_', '', $submission->data[3]['value'][0]);
        $term = taxonomy_term_load($tid);
        $education = $term->name;
      }
      ?>
      <tr>
        <td><?php print $submission->sid; ?></td>
        <td><?php print $education; ?></td>
        <td><?php print format_date($submission->submitted, 'short'); ?></td>
        <td>
          <?php print l(t('Edit'), "node/$submission->nid/submission/$submission->sid/edit", array('query' => $destination)); ?>
          <?php print l(t('Delete'), "node/$submission->nid/submission/$submission->sid/delete", array('query' => $destination)); ?>
        </td>
      </tr>
      <?php
    endforeach;
    ?>
  </table>
  <?php
  print theme('pager');
endif;
?>